//
//  YWPushManager.h
//  maintain
//
//  Created by 郑想 on 15/11/11.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import "YWSingleton.h"
//#import <AVOSCloud/AVOSCloud.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class YWMission;
@class YWLoginUser;

#define KPush_Mission @"com.ewin.push.MISSION_PROGRESS" //检测、保养任务进度
#define KPush_Trouble @"com.ewin.push.TROUBLE_PROGRESS" //完成故障任务(故障任务进度)
#define KPush_Assign @"com.ewin.push.TROUBLE.MISSION" //指派维修任务
#define KPush_Report @"com.ewin.push.TROUBLE" //报障
#define KPush_CommonMission @"com.ewin.push.MISSION" //分配检测、保养任务推送
#define KPush_ModifyMission @"com.ewin.push.MISSION_MODIFY" //修改检测、保养任务
#define KPush_WorkTask @"com.ewin.push.WORK.TASK" //临时任务
#define KPush_WorkNotice @"com.ewin.push.WORK.NOTICE" //公告
#define KPush_Reply @"com.ewin.push.REPLY" //评论
#define KPush_JsonRefresh @"com.ewin.push.JSON.REFRESH" //json文件有更新的推送

#define KPush_CancelMission @"com.ewin.push.MISSION_CANCEL" //取消检测、保养任务
#define KPush_CancelPostTrouble @"com.ewin.push.TROUBLE.CANCEL" //取消报障
#define KPush_CancelTroubleMission @"com.ewin.push.TROUBLE.MISSION.CANCEL" //撤回维修任务
#define KPush_RejectTroubleMission @"com.ewin.push.TROUBLE.MISSION.REJECT" //退回维修任务

#define KPush_InspectionMission @"com.ewin.push.INSPECTION_MISSION" //创建巡查任务
#define KPush_CancelInspectionMission @"com.ewin.push.INSPECTION_MISSION_CANCEL" //取消巡查任务
#define KPush_InspectionMissionProgress @"com.ewin.push.INSPECTION_MISSION_PROGRESS" //更新巡查任务进度
#define KPush_ModifyInspectionMission @"com.ewin.push.INSPECTION_MISSION_MODIFY" //修改巡查任务
#define KPush_FinishInspectionMission @"com.ewin.push.INSPECTION_MISSION_FINISH" //完成巡查任务
#define KPush_SystemInspectionMission @"com.ewin.push.INSPECTION_SYSTEM_RECORD" //系统生成了巡查记录

#define KPush_KeepWatchMission @"com.ewin.push.KEEPWATCH_MISSION" //创建巡更任务
#define KPush_ModifyKeepWatchMission @"com.ewin.push.KEEPWATCH_MISSION_MODIFY" //修改巡更任务
#define KPush_CancelKeepWatchMission @"com.ewin.push.KEEPWATCH_MISSION_CANCEL" //取消巡更任务
#define KPush_FinishKeepWatchMission @"com.ewin.push.KEEPWATCH_MISSION_FINISH" //完成巡更任务
#define KPush_KeepWatchMissionProgress @"com.ewin.push.KEEPWATCH_MISSION_PROGRESS" //更新巡更任务进度
#define KPush_SystemKeepWatchMission @"com.ewin.push.KEEPWATCH_SYSTEM_RECORD" //系统生成了巡更记录

#define KPush_DeleteWorkNotice @"com.ewin.push.WORK.NOTICE.DELETE" //删除通知
#define KPush_ModifyWorkNotice @"com.ewin.push.WORK.NOTICE.MODIFY"//修改通知
#define KPush_DeleteWorkTask @"com.ewin.push.WORK.TASK.DELETE" //删除临时任务
#define KPush_ModifyWorkTask @"com.ewin.push.WORK.TASK.MODIFY"//修改临时任务
#define KPush_DeleteReply @"com.ewin.push.REPLY.DELETE"

#define KPush_MATERIAL_APPLY @"com.ewin.push.MATERIAL_APPLY" //物料申请推送
#define KPush_MATERIAL_APPLY_UPDATE @"com.ewin.push.MATERIAL_APPLY_UPDATE" //物料申请抄送人
#define KPush_MATERIAL_APPLY_AT_CANCEL @"com.ewin.push.MATERIAL_APPLY_AT_CANCEL"//物料申请的at删除
#define KPush_MATERIAL_STOCK_OUT_CANCEL @"com.ewin.push.MATERIAL_STOCK_OUT_CANCEL"//物料领用的at删除
#define KPush_MATERIAL_RETURN_CANCEL @"com.ewin.push.MATERIAL_RETURN_CANCEL"//物料归还的at删除

#define KPush_MATERIAL_CANCEL @"com.ewin.push.MATERIAL_APPLY_CANCEL" //物料申请撤回
#define KPush_MATERIAL_REJECT @"com.ewin.push.MATERIAL_APPLY_REJECT" //物料申请驳回
#define KPush_MATERIAL_MATERIAL_STOCK_OUT @"com.ewin.push.MATERIAL_STOCK_OUT" //物料领用
#define KPush_MATERIAL_MATERIAL_RETURN @"com.ewin.push.MATERIAL_RETURN" //物料归还

//监控报警
#define KPush_MonitorAlarm @"com.ewin.push.EQUIPMENT_FIELD_WARN"

#define KPush_EXIT   @"com.ewin.push.EXIT"  //强制下线推送

@interface YWPushManager : NSObject

YWSingletonH(Manager)
    @property(nonatomic, copy) NSString* deviceToken;
- (void)registerRemoteNotification;
- (BOOL)openNotifyAlert;

//- (void)avosSetDeviceToken:(NSData*)deviceToken;
//- (void)avosClearBadge;

//- (void)saveEwinUser;
//手机端之间的推送
//- (void)pushToUserWithUniqueId:(NSInteger)uniqueId mission:(YWMission*)mission action:(NSString*)action;

///**
// *  订阅用户所在 公司 部门 频道
// *
// *  @param loginUser 登录用户
// */
//- (void)subscribeChannel:(YWLoginUser*)loginUser;
///**
// *  删除所有订阅的频道
// *
// *  @param block 回调代码块
// */
//- (void)deleteSubscribeChannel:(AVBooleanResultBlock)block;
///**
// *  删除avos的初始化用户信息（因为退出登录时，即退出应收不到推送）
// *
// *  @param block 回调代码块
// */
//- (void)deleteAvosEwinUser;

/**
 *  配置umeng的alias
 *
 *  @return 无
 */
- (void)setUpUMengAliasWithUser:(YWLoginUser *)loginUser;
/**
 *  配置umeng的alias
 *
 *  @return 无
 */
- (void)setUpUMengTagsWithUser:(YWLoginUser*)loginUser;
/**
 *  删除umeng的alias和tags
 *
 *  @return 无
 */
- (void)removeAllUMengAliasAndTags;
/**
 *  处理接收到的推送内容
 *
 *  @param  userInfo 字典信息
 *
 *  @return 无
 */
- (void)handleRemoteNoti:(NSDictionary*)userInfo;

@end
